<template>
	<view class="search">
		<view class="twoline">
			<view class="left">
				<view class="content">
					<uni-easyinput v-model="keyword" @clear="clearKeyword" :inputBorder="false" placeholder="请输入服务关键字">
					</uni-easyinput>
				</view>
			</view>
			<view class="right">
				<view class="btn" @click="goSearch">搜索</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword: ''
			}
		},
		methods: {
			goSearch() {
				this.$emit('goSearch', this.keyword)
			},
			clearKeyword() {
				this.$emit('clearKeyword')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.search {
		width: 95%;
		padding-top: 16rpx;
		padding-right: 30rpx;
		align-items: center;
		justify-content: center;
		background-color: #F5F6FA;
		z-index: 99999;

		.twoline {
			position: relative;
			display: flex;
			margin-left: 30rpx;
			padding: 0 20rpx;

			height: 80rpx;
			border-radius: 60rpx;
			background-color: rgba(255, 255, 255, 1);
			border: 1px solid rgba(0, 0, 0, 0.05);
			box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.18);
			justify-content: center;
			align-items: center;
			margin-bottom: 10rpx;

			.left {
				display: flex;
				flex: 80%;
				// color: #FFFFFF;
				height: 50rpx;
				margin-left: 5rpx;
				padding-right: 10rpx;
				font-size: 28rpx;

				.content {
					width: 100%;
					color: #AAAAAA;
					height: 50rpx;
					white-space: nowrap;
					display: flex;
					justify-content: space-between;
					align-items: center;
				}
			}

			.right {
				flex: 20%;
				height: 50rpx;
				color: #959497;
				padding-right: 10rpx;
				white-space: nowrap;
				font-weight: 600;
				font-size: 30rpx;

				.btn {
					position: absolute;
					top: 50%;
					transform: translateY(-50%);
					z-index: 66;
					width: 124rpx;
					height: 64rpx;
					margin-left: 8rpx;
					font-size: 28rpx;
					line-height: 64rpx;
					text-align: center;
					color: #FFFFFF;
					background: linear-gradient( 270deg, #88ACFF 0%, #2165FF 100%);
					box-shadow: 0px 0px 4px 1px rgba(0,0,0,0.16);
					border-radius: 40rpx 40rpx 40rpx 40rpx;
					opacity: 1;
				}
			}
		}

	}
</style>